home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / glibc108.zip / glibc108 / sysdeps / alpha / remlu.S < prev    next >
Text File  |  1993-12-22  |  931b  |  58 lines

  1.       /* This file is generated from divrem.m4; DO NOT EDIT! */
  2. /* For each N divided by D, we do:
  3.       result = (double) N / (double) D
  4.    Then, for each N mod D, we do:
  5.       result = N - (D * divMODE (N, D))
  6.  
  7.    FIXME:
  8.    The q and qu versions won't deal with operands > 50 bits.  We also
  9.    don't check for divide by zero.  */
  10.  
  11. #include "DEFS.h"
  12. #if 0
  13. /* We do not handle div by zero yet.  */
  14. #include <machine/pal.h>
  15. #endif
  16. #include <regdef.h>
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23. FUNC__(remlu)
  24.     ! First set up the dividend.
  25.         zapnot t10, 0xf, t10
  26.  
  27.     stq t10,0(sp)
  28.     ldt $f10,0(sp)
  29.     cvtqt $f10,$f10
  30.     
  31.  
  32.     ! Then set up the divisor.
  33.         zapnot t11, 0xf, t11
  34.  
  35.     stq t11,0(sp)
  36.     ldt $f1,0(sp)
  37.     cvtqt $f1,$f1
  38.     
  39.  
  40.     ! Do the division.
  41.     divt $f10,$f1,$f10
  42.     cvttqc $f10,$f10
  43.  
  44.     ! Put the result in t12.
  45.     stt $f10,0(sp)
  46.     ldq t12,0(sp)
  47.         sextl t12, t12
  48.  
  49.  
  50.         ! Compute the remainder.
  51.     mull t11, t12, t11
  52.     subl t10, t11, t12
  53.  
  54.  
  55.     lda sp,16(sp)
  56.     ret zero,(t9),1
  57.     .end NAME__(remlu)
  58.